<template>
	<view class="pointsProduct" @click="details">
		<image :src="props.item.coverImg" mode="aspectFill" class="pointsProduct-cover block"></image>
		<view class="pointsProduct-main border-box">
			<view class="pointsProduct-main-name omit1">{{props.item.title}}</view>
			<view class="pointsProduct-main-sub flex justify-content_space-between align-item_center">
				<view class="pointsProduct-main-sub-point">
					{{props.item.point|| 0}}<text>积分</text>
				</view>
				<view class="pointsProduct-main-sub-sale">
					已领：{{props.item.saleCount||0}}
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	const props = defineProps({
		item: {
			type: Object,
		}
	})
	const details = () => {
		uni.navigateTo({
			url: "/pointProduct/product/index" + `?id=${props.item.id}`
		})
	}
</script>

<style scoped lang="scss">
	.pointsProduct {
		width: 335rpx;
		background: #33303F;
		border-radius: 8rpx;
		margin-top: 20rpx;

		&-cover {
			width: 335rpx;
			height: 335rpx;
			background: #FFFFFF;
			border-radius: 8rpx 8rpx 0rpx 0rpx;
		}

		&-main {
			padding: 20rpx;

			&-name {
				font-weight: 500;
				font-size: 30rpx;
				color: #FFFFFF;
			}

			&-sub {
				margin-top: 10rpx;

				&-point {
					font-weight: 600;
					font-size: 36rpx;
					color: #FFC75C;

					text {
						font-size: 26rpx;
					}
				}

				&-sale {
					font-weight: 400;
					font-size: 22rpx;
					color: #FFFFFF;
					opacity: 0.4;
				}
			}
		}

	}
</style>